package com.vic.designpattern.patterns.c_behavioral.state.demo3;

/**
 * @author victor
 */
public class ScoreContext {

    /**
     * 当前状态
     */
    AbstractState state;

    public ScoreContext() {
        // 初始状态为不及格
        this.state = new LowState(this);
    }

    public AbstractState getState() {
        return state;
    }

    public void setState(AbstractState state) {
        this.state = state;
    }

    /**
     * 加分数
     * @param score
     */
    public void add(int score) {
        state.addScore(score);
    }
}
